package org.smr.dev;

/**
 * 数据库类型枚举
 * @author LUSHUIFA
 *
 */
public enum ColumnTypeEnum {
	 VARCHAR2("VARCHAR2","java.lang.String"),
	 VARCHAR("VARCHAR","java.lang.String"),
	 NUMBER("NUMBER","java.lang.Double"),
	 DOUBLE("DOUBLE","java.lang.Double"),
	 DATETIME("DATETIME","java.util.Date"),
	 CHAR("CHAR","java.lang.String"),
	 INT("INT","java.lang.Integer"),
	 TINYINT("TINYINT","java.lang.Integer"),
     BIGINT("BIGINT","java.lang.Long"),
	 BIT("BIT","java.lang.Boolean");

	private String dbType;
     private String javaType;
     
     ColumnTypeEnum(String dbType,String javaType){
    	 this.dbType = dbType;
    	 this.javaType = javaType;
     }
     
     public static String getColumnTypeEnumByDBType(String dbType){
         for(ColumnTypeEnum columnTypeEnum:ColumnTypeEnum.values()){
             if(columnTypeEnum.getDbType().equals(dbType)){
                 return columnTypeEnum.getJavaType();
             }
         }
		return "";
     }

	public String getDbType() {
		return dbType;
	}

	public void setDbType(String dbType) {
		this.dbType = dbType;
	}

	public String getJavaType() {
		return javaType;
	}

	public void setJavaType(String javaType) {
		this.javaType = javaType;
	}
}
